package com.kgcx.coupon.domain;

import com.kgcx.common.annotation.dict.Dict;
import com.kgcx.dbutils.annotation.SelectGreaterThanOrEqual;
import com.kgcx.dbutils.annotation.SelectLessThanOrEqual;
import com.kgcx.dbutils.annotation.SelectOneOfThem;
import com.kgcx.dbutils.domain.BaseDomain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import tk.mybatis.mapper.annotation.ColumnType;

import javax.persistence.Table;
import javax.persistence.Transient;
import java.sql.Timestamp;

/**
 * 优惠卷
 *
 * @author wu
 */
@Table(name = "t_coupon_info")
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel("优惠券")
public class CouponInfo extends BaseDomain {

    public static final Long STATE_USED = 2L;
    public static final Long STATE_UNUSED = 1L;
    public static final Long STATE_USING = 3L;

    @ApiModelProperty(value = "乘客ID", required = true, example = "1")
    private Long customerId;

    @ApiModelProperty(value = "编码", readOnly = true, example = "112312")
    private String code;

    @ApiModelProperty(value = "优惠卷金额", required = true, example = "20")
    private Long money;

    @ApiModelProperty(value = "优惠卷过期日期Timestamp时间戳", required = true, example = "1513973105000")
    @SelectGreaterThanOrEqual
    private Timestamp expTime;

    @ApiModelProperty(value = "优惠卷起始使用日期Timestamp时间戳", required = true, example = "1513973105000")
    @SelectLessThanOrEqual
    private Timestamp effTime;

    @ApiModelProperty(value = "限用城市String类型", required = true, example = "武汉")
    private String city;

    @ApiModelProperty(value = "优惠服务类型,字典：orderType。1-立即接机，2-立即接站，3-预约接机，4-预约接站，5-预约送机，6-预约送站，7-预约用车  8-立即用车", required = true, example = "1")
    @SelectOneOfThem(passWord = "0")
    private String orderType;

    @ApiModelProperty(value = "触发金额Integer", required = true, example = "20")
    @SelectLessThanOrEqual
    @ColumnType(column = "`trigger`")
    private Long trigger;

    @ApiModelProperty(value = "用车类型 ,字典：vehiclePurpose。 公务轿车1  商务七座2  豪华轿车3", required = true, example = "1")
    @SelectOneOfThem(passWord = "0")
    private String vehiclePurpose;

    @ApiModelProperty(value = "使用渠道,字典：orderChannel。：1-小程序，2-管理后台，3-iOS，4-安卓", required = true, example = "1")
    @SelectOneOfThem(passWord = "0")
    private String orderChannel;

    @ApiModelProperty(value = "运价类型,字典：fareType。 1：常规价 2：套餐价 3：一口价", required = true, example = "1")
    @SelectOneOfThem(passWord = "0")
    private String fareType;

    @ApiModelProperty(value = "使用者,字典：useType。：1=本人使用，2=替他人叫车使用", required = true, example = "1")
    @SelectOneOfThem(passWord = "0")
    private String useType;

    @ApiModelProperty(value = " 状态 2 已使用 1未使用", required = true, example = "1")
    private Long state;

    @ApiModelProperty(value = " 城市id", required = true, example = "3500")
    @SelectOneOfThem(passWord = "0")
    private String availableCity;

    @ApiModelProperty(value = "  优惠卷名称", required = true, example = "接机卷")
    private String name;

    @ApiModelProperty(value = "  领取优惠卷时间", required = true, example = "1499382427000")
    private Timestamp getcoupontime;

    @Transient
    private Timestamp expTimeGe;

    @Transient
    private Long triggerLe;

    @Transient
    private Timestamp effTimeLe;

    @ApiModelProperty(value = "优惠服务类型1-立即接机，2-立即接站，3-预约接机，4-预约接站，5-预约送机，6-预约送站，7-预约用车  8-立即用车", readOnly = true, example = "立即用车")
    @Dict(type = "orderType", fieldName = "orderType")
    @Transient
    private String orderTypeValue;

    @ApiModelProperty(value = "用车类型  公务轿车1  商务6座2  豪华轿车3", readOnly = true, example = "公务轿车")
    @Dict(type = "vehiclePurpose", fieldName = "vehiclePurpose")
    @Transient
    private String vehiclePurposeValue;

    @ApiModelProperty(value = "使用渠道：1-小程序，2-管理后台，3-iOS，4-安卓", readOnly = true, example = "app")
    @Dict(type = "orderChannel", fieldName = "orderChannel")
    @Transient
    private String orderChannelValue;

    @ApiModelProperty(value = "运价类型 1：常规价 2：套餐价 3：一口价", readOnly = true, example = "常规价")
    @Dict(type = "fareType", fieldName = "fareType")
    @Transient
    private String fareTypeValue;

    @ApiModelProperty(value = "使用者：1=本人使用，2=替他人叫车使用", readOnly = true, example = "本人使用")
    @Dict(type = "useType", fieldName = "useType")
    @Transient
    private String useTypeValue;

    @Transient
    private String orderTypeOot;

    @Transient
    private String vehiclePurposeOot;
    @Transient
    private String orderChannelOot;
    @Transient
    private String fareTypeOot;
    @Transient
    private String useTypeOot;
    @Transient
    private String availableCityOot;

}
